﻿using System;
using System.Collections.Generic;
using Shell.DomainDot;
using Shell.PocoDot;

namespace MyMvcApplication
{
    internal class MockContainer : IObjectSeeker
    {
        public T Seek<T>() where T : class
        {
            if (typeof(T).IsAssignableFrom(typeof(IRepositoryFactory)))
            {
                return new EfRepositoryFactory() as T;
            }
            if (typeof(T).IsAssignableFrom(typeof(IDataContextFactory)))
            {
                return new EfDataContextFactory() as T;
            }
            return Activator.CreateInstance(typeof(T)) as T;
        }

        public IEnumerable<T> SeekAll<T>() where T : class
        {
            return null;
        }

        public void Dispose()
        {
        }
    }
}